using System;
using System.Collections.Generic;

namespace Mbs.Elements
{
    /// <summary>
    /// 命令职责库
    /// </summary>
    public interface IElementCommandRepository : IEnumerable<KeyValuePair<string, IElementCommand>>, IDisposable
    {

        /// <summary>
        /// 得到或创建命令
        /// </summary>
        /// <param name="commandName">命令名称</param>
        /// <returns>返回命令</returns>
        /// <remarks>
        /// 如果集合中不包含特定的命令对象则创建
        /// </remarks>
        IElementCommand this[string commandName] { get; }

        /// <summary>
        /// 移除命令对象
        /// </summary>
        /// <param name="commandName">命令名称</param>
        void Remove(string commandName);
    }
}
